using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CollegeShop.Infrastructure.Entities.Repository;

namespace CollegeShop.Infrastructure.Entities.Entity
{
    public class Userrole : IAccessible<T_Userrole, Userrole>, ILogicEntity<T_Userrole, Userrole>
    {
        public int ID { get; set; }

        public int UserID { get; set; }

        public int RoleID { get; set; }

        public int IsCanmanage { get; set; }

        protected override void Covariant(T_Userrole model)
        {
            if (model != null)
            {
                    this.ID = model.ID;
                    this.UserID = model.UserID;
                    this.RoleID = model.RoleID;
                    this.IsCanmanage = model.IsCanmanage;
            }
}
        protected override T_Userrole Inverter(Userrole model)
        {
            if (model != null)
            {
                return new T_Userrole()
                {
                    ID = model.ID,
                    UserID = model.UserID,
                    RoleID = model.RoleID,
                    IsCanmanage = model.IsCanmanage,
                };
            }
            return null;
        }
        public Userrole Set(T_Userrole dbModel)
        {
            Covariant(dbModel);
            return this;
        }
    }
}
